import request from '@/config/axios'

// 礼物 VO
export interface GiftsVO {
  id: number // 编号
  giftName: string // 礼物名
  giftPrice: number // 灵境币
  amount: number // 提现金额
  giftImage: string // 礼物图片
  giftGif: string // 礼物动画
  status: boolean // 状态
}

// 礼物 API
export const GiftsApi = {
  // 查询礼物分页
  getGiftsPage: async (params: any) => {
    return await request.get({ url: `/system/gifts/page`, params })
  },

  // 查询礼物详情
  getGifts: async (id: number) => {
    return await request.get({ url: `/system/gifts/get?id=` + id })
  },

  // 新增礼物
  createGifts: async (data: GiftsVO) => {
    return await request.post({ url: `/system/gifts/create`, data })
  },

  // 修改礼物
  updateGifts: async (data: GiftsVO) => {
    return await request.put({ url: `/system/gifts/update`, data })
  },

  // 删除礼物
  deleteGifts: async (id: number) => {
    return await request.delete({ url: `/system/gifts/delete?id=` + id })
  },

  // 导出礼物 Excel
  exportGifts: async (params) => {
    return await request.download({ url: `/system/gifts/export-excel`, params })
  },
}
